Skip to content

ops: remove bridge tmux guidance, keep tmux for agent sessions#140

Merged
benvinegar merged 4 commits intomainfrom
cleanup/remove-tmux-guidance
Feb 23, 2026
Merged

ops: remove bridge tmux guidance, keep tmux for agent sessions#140
benvinegar merged 4 commits intomainfrom
cleanup/remove-tmux-guidance

Conversation

@benvinegar
Copy link
Copy Markdown
Member

@benvinegar benvinegar commented Feb 23, 2026

Summary

Remove Slack bridge-specific tmux guidance and restart flow, while keeping tmux-based management for other Pi agent sessions.

Changes

  • start.sh
    • Bridge now runs as a normal background process with PID/log files:
      • ~/.pi/agent/slack-bridge.pid
      • ~/.pi/agent/logs/slack-bridge.log
  • pi/skills/control-agent/startup-cleanup.sh
    • Bridge restart is PID/process-based (no tmux bridge session)
    • Emits bridge PID/log path and keeps API readiness check
  • pi/skills/control-agent/SKILL.md
    • Replaced bridge tmux restart instructions with process/log guidance
    • Heartbeat remediation for bridge-down now points to startup-cleanup.sh + log check

Kept intentionally

  • tmux support for non-bridge workflows (dev/sentry sessions)
  • tmux CLI/attach/session behavior remains available for other Pi sessions
  • install deps still include tmux

Validation

  • bash bin/baudbot.test.sh

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 23, 2026

Greptile Summary

Migrated Slack bridge from tmux session management to standard PID-based process management, making the bridge lifecycle consistent with typical daemon patterns.

  • Removed tmux session creation/cleanup for slack-bridge across start.sh, startup-cleanup.sh, and restart flow
  • Bridge now runs as background process with PID tracking (~/.pi/agent/slack-bridge.pid) and dedicated logging (~/.pi/agent/logs/slack-bridge.log)
  • Maintained restart loop in start.sh for automatic recovery on bridge exits
  • Updated documentation and tests to reflect new process management approach
  • Kept tmux support for other agent sessions (dev-agent, sentry-agent)

Confidence Score: 4/5

  • This PR is safe to merge with one logic issue that should be addressed
  • The refactoring is well-implemented with comprehensive test updates and documentation changes. However, there's a PID tracking issue in start.sh where the PID file stores the subshell PID instead of the actual Node process, which could affect process management when the bridge restarts within the loop.
  • Pay close attention to start.sh - the PID tracking implementation needs review

Important Files Changed

Filename Overview
start.sh Replaced tmux-based bridge management with PID/log file-based process management
pi/skills/control-agent/startup-cleanup.sh Migrated from tmux session control to PID-based process management for bridge restarts
bin/baudbot Removed bridge tmux session cleanup from restart command

Last reviewed commit: b1c8ced

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread start.sh
sleep 5
done
) &
echo $! > "$BRIDGE_PID_FILE"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PID file stores the subshell PID, not the actual Node process. When the bridge exits and the while true loop restarts it, the PID file becomes stale, pointing to the subshell wrapping the loop rather than tracking each new Node process instance.

Prompt To Fix With AI
This is a comment left during a code review.
Path: start.sh
Line: 113

Comment:
The PID file stores the subshell PID, not the actual Node process. When the bridge exits and the `while true` loop restarts it, the PID file becomes stale, pointing to the subshell wrapping the loop rather than tracking each new Node process instance.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good callout. In this case the PID file is intentionally storing the supervisor subshell PID (the restart loop), not the child node PID. That PID remains stable across child restarts and is the one we need to kill to stop bridge supervision.

I added an inline clarification comment next to the PID write so this intent is explicit.

Responded by pi-coding-agent using openai/gpt-5.

Comment thread pi/skills/control-agent/startup-cleanup.sh Outdated
Comment thread pi/skills/control-agent/startup-cleanup.sh Outdated
@benvinegar benvinegar merged commit c6e566f into main Feb 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant